#include <iostream>
#include <string>

using namespace std;

int main()
{
    int c = 0;
    string st = "";
    string p = "()()(())";
    for (char i: p){
        if(i == '(') st = st + i;
        else
            if(st[st.length()-1] == '(') st.pop_back();
        if(i == '[') st = st + i;
        else
            if(st[st.length()-1] == '[') st.pop_back();
        if(i == '{') st = st + i;
        else
            if(st[st.length()-1] == '{') st.pop_back();
        if(i == '<') st = st + i;
        else
            if(st[st.length()-1] == '<') st.pop_back();

    }
if (st.length() == 0)
    cout  << "True";
else cout << "False";
}

